package com.sangeng.domain.entity.user;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Menu implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO,value = "id")
    @JSONField(name = "id")
    private Long id;              // 主键ID

    @TableField("menu_name")
    @JSONField(name = "menu_name")
    private String menuName;      // 菜单名

    @TableField("path")
    @JSONField(name = "path")
    private String path;          // 路由地址

    @TableField("component")
    @JSONField(name = "component")
    private String component;     // 组件路径

    @TableField("visible")
    @JSONField(name = "visible")
    private String visible;       // 显示状态（0显示 1隐藏）

    @TableField("status")
    @JSONField(name = "status")
    private String status;        // 菜单状态（0正常 1停用）

    @TableField("perms")
    @JSONField(name = "perms")
    private String perms;         // 权限标识

    @TableField("icon")
    @JSONField(name = "icon")
    private String icon;          // 菜单图标

    @TableField("create_by")
    @JSONField(name = "create_by")
    private Long createBy;        // 创建人ID

    @TableField("create_time")
    @JSONField(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;      // 创建时间

    @TableField("update_by")
    @JSONField(name = "update_by")
    private Long updateBy;        // 更新人ID

    @TableField("update_time")
    @JSONField(name = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;      // 更新时间

    @TableField("del_flag")
    @JSONField(name = "del_flag")
    private Integer delFlag;      // 是否删除（0未删除 1已删除）

    @TableField("remark")
    @JSONField(name = "remark")
    private String remark;        // 备注
}
